<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.bootcss.com/minireset.css/0.0.2/minireset.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>
    <script>
        $(function ($) {
            var canvas = $('#canvas'),
                context = canvas.get(0).getContext('2d')
            
            drawBg()
            
            $(window).resize(function () {
                drawBg()
            })

            function drawBg() {
                canvas.attr('width', $(window).get(0).innerWidth)
                canvas.attr('height', $(window).get(0).innerHeight)
                context.fillRect(0, 0, canvas.width(), canvas.height())
            }

            
        })
    </script>
</head>

<body>
    <canvas id="canvas"></canvas>

    <script>

    </script>
</body>

</html>